clear all
close all

load Shape_Jupiter_Saturn_shape_results.mat

set(gcf,'Position',[1500 5000 [1200 800]]);

fs=17;
fac1=1;
set(gcf,'PaperPositionMode','auto');
set(0,'DefaultAxesFontSize',fac1*fs)
set(0,'DefaultTextFontSize',fac1*fs)
set(0,'DefaultLineLinewidth',fac1*3)


light_red=[1 0.5*[1 1]];
col_gray=0.6*[1 1 1];
occ_size=12;

yticks=-60:30:60;

subplot(2,2,1)
plot(theta_deg,shape_total_100mb(1,:)/1e3,'Color',[0, 0.4470, 0.7410]);
hold on
plot(Occ_J_100mb(:,1),Occ_J_100mb(:,2),'ok','MarkerSize',occ_size,'MarkerFaceColor','r')
axis([-90 90 66500 72000 ])
text(0,1.06,'(a)','Units','normalized','FontWeight','bold','FontSize',fac1*fs*1.1)
grid
title 'Jupiter'
ylabel 'Radius (km)'
ax = gca; ax.YAxis.Exponent = 0; ax.YAxis.TickLabelFormat = '%,.0f';
set(gca,'XTick',yticks)
box on

subplot(2,2,2)
plot(theta_deg,shape_total_100mb(2,:)/1e3)
hold on
plot(Occ_S_100mb(:,1),Occ_S_100mb(:,2),'ok','MarkerSize',occ_size,'MarkerFaceColor','r')
axis([-90 90 54000 61000 ])
text(0,1.06,'(b)','Units','normalized','FontWeight','bold','FontSize',fac1*fs*1.1)
grid
title 'Saturn'
ax = gca; ax.YAxis.Exponent = 0;ax.YAxis.TickLabelFormat = '%,.0f';
set(gca,'XTick',yticks)
box on


subplot(2,2,3)
plot(theta_deg,h_winds_100mb(1,:)/1e3);
hold on
h(2)=errorbar(Occ_J_res_1bar(:,1),Occ_J_res_1bar(:,2),5*ones(length(Occ_J_res_1bar),1),'o','vertical','Color',col_gray,'MarkerSize',occ_size,'MarkerFaceColor',light_red,'LineWidth',2);
h(1)=errorbar(Occ_J_res_100mb(:,1),Occ_J_res_100mb(:,2),5*ones(length(Occ_J_res_100mb),1),'ok','vertical','MarkerSize',occ_size,'MarkerFaceColor','r','LineWidth',2);
axis([-90 90 -20 20])
text(0,1.06,'(c)','Units','normalized','FontWeight','bold','FontSize',fac1*fs*1.1)
grid
ylabel 'Dynamical height (km)'
xlabel 'Latitude'
set(gca,'XTick',yticks)
legend(h,'Occultations (100 mb)','Occultations (1 bar)','Location','northeast','Fontsize',14)
box on

subplot(2,2,4)
hold on
h(4)=plot(theta_deg,h_winds_obs_100mb(2,:)/1e3);
h(1)=plot(theta_deg,h_winds_100mb(2,:)/1e3,'-.','Color',col_gray);
h(3)=errorbar(Occ_S_res_1bar(:,1),Occ_S_res_1bar(:,2),5*ones(length(Occ_S_res_1bar),1),'o','vertical','Color',col_gray,'MarkerSize',occ_size,'MarkerFaceColor',light_red,'LineWidth',2);
h(2)=errorbar(Occ_S_res_100mb(:,1),Occ_S_res_100mb(:,2),5*ones(length(Occ_S_res_100mb),1),'ok','vertical','MarkerSize',occ_size,'MarkerFaceColor','r','LineWidth',2);
axis([-90 90 -20 50])
text(0,1.06,'(d)','Units','normalized','FontWeight','bold','FontSize',fac1*fs*1.1)
grid
%xlabel 'Altitude (km)'
xlabel 'Latitude'
set(gca,'XTick',yticks)
set(gca,'YTick',-40:20:40)
%legend(h,'Wind induced (observed)','Wind induced (optimized)','Occultations (1 bar)','Occultations (100 mb)','Location','northeast','Fontsize',12)
box on

